﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Text;

using DanielVaughan.ComponentModel;

namespace WpfCore.Tests.Mocks
{
	class MockNotifyPropertyChanged : INotifyPropertyChanged
	{
		readonly PropertyChangedNotifier propertyChangedNotifier;

		public event PropertyChangedEventHandler PropertyChanged
		{
			add
			{
				propertyChangedNotifier.PropertyChanged += value;
			}
			remove
			{
				propertyChangedNotifier.PropertyChanged -= value;
			}
		}

		public MockNotifyPropertyChanged()
		{
			propertyChangedNotifier = new PropertyChangedNotifier(this);
		}

		string testProperty1;

		public string TestProperty1
		{
			get
			{
				return testProperty1;
			}
			set
			{
				testProperty1 = value;
				propertyChangedNotifier.OnPropertyChanged("TestProperty1");
			}
		}

		string testProperty2;

		public string TestProperty2
		{
			get
			{
				return testProperty2;
			}
			set
			{
				testProperty2 = value;		
				propertyChangedNotifier.OnPropertyChanged((MockNotifyPropertyChanged mock) => mock.TestProperty2);
			}
		}

//		string testProperty3;
//
//		public string TestProperty3
//		{
//			get
//			{
//				return testProperty3;
//			}
//			set
//			{
//				testProperty3 = value;
//				propertyChangedNotifier.OnPropertyChanged(ref TestProperty3);
//			}
//		}

	}
}
